
export function savePhone(phones) {
  if (!Array.isArray(phones)) {
    phones = [phones]
  }
  let list = [...getPhones(), ...phones];
  localStorage.setItem('phoneList', JSON.stringify(Array.from(new Set(list))))
}

export function getPhones() {
  const res = localStorage.getItem('phoneList')
  return res ? JSON.parse(res) : [];
}
